/**
 * 
 */
package edu.fjnu.fundsys.service.impl;

import java.util.List;

import edu.fjnu.fundsys.dao.AccountTransinfoDao;
import edu.fjnu.fundsys.dao.FundHoldingDao;
import edu.fjnu.fundsys.dao.impl.AccountTransinfoDaoJDBCImpl;
import edu.fjnu.fundsys.dao.impl.FundHoldingDaoJDBCImpl;
import edu.fjnu.fundsys.domain.FundHolding;
import edu.fjnu.fundsys.service.FundHoldingService;
import edu.fjnu.fundsys.utils.Page;

/**
 * @author BaiXiang
 *
 */
public class FundHoldingServiceImpl implements FundHoldingService {

	public void add(FundHolding fundholding) {
		// TODO Auto-generated method stub
		FundHoldingDao fundHoldingDao = new FundHoldingDaoJDBCImpl();
		fundHoldingDao.add(fundholding);
	}

	public void update(FundHolding fundholding) {
		// TODO Auto-generated method stub
		FundHoldingDao fundHoldingDao = new FundHoldingDaoJDBCImpl();
		fundHoldingDao.update(fundholding);
	}

	public FundHolding getFundHloding(FundHolding fundholding) {
		// TODO Auto-generated method stub
		FundHoldingDao fundHoldingDao = new FundHoldingDaoJDBCImpl();
		return fundHoldingDao.getFundHloding(fundholding);
	}

	public void delete(Integer hid) {
		// TODO Auto-generated method stub
		FundHoldingDao fundHoldingDao = new FundHoldingDaoJDBCImpl();
		fundHoldingDao.delete(hid);
	}

	public List<FundHolding> loadByAccountNo(Integer accountno) {
		// TODO Auto-generated method stub
		FundHoldingDao fundHoldingDao = new FundHoldingDaoJDBCImpl();
		return fundHoldingDao.loadByAccountNo(accountno);
	}

	public Page loadPageInfo(Page page, Integer accountNo) {
		// TODO Auto-generated method stub
		FundHoldingDao fundHoldingDao = new FundHoldingDaoJDBCImpl();
		page.setTotalRecNum(fundHoldingDao.cntInfos(accountNo));
		page.setPageContent(fundHoldingDao.getSelectInfos(accountNo, page.getStartIndex(), page.getEndIndex()));
		return page;
	}

}
